package com.mallotec.android.timenote.data.bean;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Calendar;
import java.util.Date;

/**
 * @description 时间记录类 TODO：JSR303校验
 * @author angbeats
 * @create 2020-09-22 22:16
 **/
@Data
@Accessors(chain = true)
//@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(tableName = "timenote")
public class Timenote  {

//    @NonNull
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    private Integer id;

    /**
     * 开始时间
     */
    @NonNull
    private Calendar startDatetime;

    /**
     * 计划结束时间
     */
    @NonNull
    private Calendar preEndDatetime;

    /**
     * 结束时间
     */
    private Calendar endDatetime;

    /**
     * 类别
     */
    @NonNull
    private String timenoteType;

    /**
     * 内容
     */
    @NonNull
    private String timenoteContent;

    /**
     * 是否被逻辑删除 0:未删除 1:已删除
     */
    private Integer hasDeleted;

    /**
     * 内容+类别+开始时间+结束时间 hash值
     */
    private String uniqueKey;

    /**
     * 删除时间
     */
    private Calendar deletedDatetime;
}